<%--
  Created by IntelliJ IDEA.
  User: KaiFaBu010
  Date: 2017-12-09
  Time: 20:27
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <jsp:include page="/WEB-INF/jsp/head.jsp">
        <jsp:param value="银行卡修改" name="pageTitle"/>
    </jsp:include>
    <script src="/js/common.js"></script>
</head>
<body>
<div class="easyui-panel" title="银行卡修改" data-options="iconCls:'icon-add',fit:true,border:false">
    <div>
        <a href="/bankCard/home" id="lbtnBack" class="easyui-linkbutton"><i class="fa fa-backward"></i>&nbsp;返回</a>
    </div>
    <form id="updateBankCardTb" action="/bankCard/updataBankCard" method="post">
        <table class="yj-table" cellpadding="0" cellspacing="0">
            <tr>
                <td style="width:100px;">银行卡卡号</td>
                <td>
                    <input class="yj-text" id="bid" name="bid" value="${bankCard.bid}" hidden="hidden"/>
                    <input class="yj-text" id="codenumber" name="codenumber" value="${bankCard.codenumber}"/>
                </td>

                <td>别名</td>
                <td>
                <input class="yj-text" id="alias" name="alias" value="${bankCard.alias}"/>
                </td>

            </tr>
            <tr>
                <td style=" width:100px;">所属银行</td>
                <td>
                    <input class="yj-text" id="thebankM" name="thebankM" value="${bankCard.thebank}" hidden="hidden"/>
                    <select class="yj-select" type="text" id="thebank" name="thebank">
                        <option class="yj-text" type="text" value="0">工行</option>
                        <option class="yj-text" type="text" value="1">农行</option>
                        <option class="yj-text" type="text" value="2">建行</option>
                        <option class="yj-text" type="text" value="3">商行</option>
                    </select>
                </td>
                <td>卡上金额</td>
                <td>
                <input class="easyui-numberbox yj-text" type="text" id="initialnum" groupSeparator=","
                       data-options="min:0,precision:2,required:true"
                       style="text-align:right" name="initialnum" value="${bankCard.initialnum}"/>
                 </td>
            </tr>
            <tr>
                <td>所属游戏</td>
                <td>
                    <select class=" yj-select" style="width: 100px" type="text" id="thegameid"  name="thegameid"
                            data-options="required:true" data-value="${bankCard.thegameid}" >
                    </select>
                </td>


            </tr>

        </table>
        <div style="margin-top:15px;padding-bottom: 15px;">
            <button id="btnAdd" type="submit" class="easyui-linkbutton"><i class="fa fa-save"></i>&nbsp;保存</button>
            <a href="/bankCard/home" id="lbtnoff" class="easyui-linkbutton"><i class="fa fa-backward"></i>&nbsp;取消</a>
        </div>
    </form>
</div>
<script>





    //关联游戏显示
    $("#thegameid").combobox({
        url: "/games/getAllNo",
        valueField: "gid",
        textField: "gname",
        editable: false
    });




    $("#updateBankCardTb").validator({
        theme: "yellow_right",
        fields: {
            codenumber: {
                rule: "required;length(~15);decimal"
            },
            alias: {
                rule: "required;"
            },
            thebank: {
                rule: "required;"
            },
            initialnum: {
                rule: "required;length(~15);decimal"
            },
            thegame: {
                rule: "required;"
            }

        }, valid: function (form) {
            $(form).form('submit', {
                success: function (data) {
                    console.log(data);
                    var newdata = JSON.parse(data);
                    $.messager.alert('提示信息', newdata['msg'], 'info', function () {
                        //跳转地址
                        location.href = "/bankCard/home";
                    });
                    $('.panel-tool-close').hide();//隐藏关闭按钮
                }
            });
        }
    });


</script>

</body>
</html>
